package io.renren.controller;

import io.renren.entity.Result;
import io.renren.entity.SubjectEntity;
import io.renren.service.SubjectService;
import io.renren.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * describe:
 * create @ kylin  2019/03/10
 */
@RestController
@RequestMapping("/api/subj")
@Api(tags = "科目相关")
public class ApiSubjectController {
    @Autowired
    private SubjectService subjectService;

    @GetMapping("/list")
    @ApiOperation(value = "获取所有科目")
    public Result<SubjectEntity> list() throws Exception{
        return ResultUtil.success(this.subjectService.list());
    }
}
